/**
 * 
 */
package org.lansir.af.dataview;

import java.util.Calendar;

import org.lansir.af.database.DataRowActivityParticipator;
import org.lansir.af.database.Database;

import android.database.Cursor;

/**
 * @author 蓝智宏
 *
 */
public class DataViewActivityParticipator extends DataView {

	/**
	 * @param db
	 */
	public DataViewActivityParticipator(Database db, long iActivityId) {
		super(db);
		sTableName = Database.sTableNameActivityParticipator;
		sQuery = "select * from %s where ActivityID = " + iActivityId;
	}

	
	@Override
	protected void addItem(Cursor cr) {
		DataViewItemActivityParticipator dataViewItemActivityParticipator = new DataViewItemActivityParticipator();
		dataViewItemActivityParticipator.setID(cr.getLong(DataRowActivityParticipator.fid.ID));
		dataViewItemActivityParticipator.setActivityId(cr.getLong(DataRowActivityParticipator.fid.ActivityID));
		dataViewItemActivityParticipator.setParticipatorId(cr.getString(DataRowActivityParticipator.fid.ParticipatorID));
		dataViewItemActivityParticipator.setParticipatorName(cr.getString(DataRowActivityParticipator.fid.ParticipatorName));
		dataViewItemActivityParticipator.setOther(cr.getLong(DataRowActivityParticipator.fid.IsOther) == 1);
		dataViewItemActivityParticipator.setReply(cr.getInt(DataRowActivityParticipator.fid.Reply));
		
		rows.add(dataViewItemActivityParticipator);
	}


	@Override
	protected void filterDataForView(DataViewItem item, Calendar calStartDate, int dayType) {
		

	}


	@Override
	protected void filterDataPrepare(Calendar calStartDate, int dayType) {
		
	}

	
	@Override
	protected void sortView() {
		
	}

}
